Request ASGI attributes passed to Sampler#1762
Request ASGI attributes passed to Sampler#1762srikanthccv merged 7 commits intoopen-telemetry:mainfrom
Conversation
|
Could you update the tests? The attributes are changed so the expected attributes in tests should be updated too |
Hi @shalevr, the final span attributes are the same before and after the code update. The tests in |
Head branch was pushed to by a user without write access
|
I've added 7d91b86 to fix a failed test in the This seems to have fixed the |
|
@srikanthccv @shalevr any chance we can get this merged in soon? |
Description
This adds HTTP server request attributes to the ASGI instrumentation library's start_span call, making them available to otel sampler's should_sample method. A very basic example:
Before this change,
attributesis None. After this change,attributesfor an instrumented ASGI app would be:Fixes #1752
Type of change
How Has This Been Tested?
I have a custom distro that configures the attribute-logging sampler code in the above Description. On my local I run a FastAPI app with
opentelemetry-instrumentafter local install ofopentelemetry-instrumentation-asgi==0.39b0.devand its dependencies. Then Icurlthe app's/healthcheckroute to see stdout logs of the attributes.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.